package com.young.msg.web;

import com.young.common.util.Result;
import com.young.interfaces.log.annotation.Log;
import com.young.msg.core.MailSenderControlCenter;
import com.young.msg.model.MailSendCommand;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * 邮箱web
 *
 * @author wangjy
 * @date 2021/10/30 14:53:31
 */
@Controller
@RequestMapping("/msg/mail")
public class MsgMailController {

    @Log("发送邮件")
    @RequestMapping(value = "/sendMail", method = {RequestMethod.POST})
    @ResponseBody
    public Object sendMail(MailSendCommand mailSendCommand) {
        MailSenderControlCenter.send(mailSendCommand);
        return Result.buildSuccess();
    }
}
